package com.lishe.lishe.lishe.module.myorder.bean;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by shino on 2017/12/27.
 */

public class TradeDataObject implements Serializable {

    //订单关闭状态
    @SerializedName("cancel_status")
    private String cancel_status;

    //生成时间
    @SerializedName("created_time")
    private String created_time;

    //订单列表
//    默认无操作：NO_APPLY
//    有退款：REFUND/CANCEL_REFUND
//    有退货：RETURN/CANCEL_RETURN
//    有换货：EXCHANGE/CANCEL_EXCHANGE
//    有维修：REPAIR/CANCEL_REPAIR
    @SerializedName("orderList")
    private List<GoodObject> orderList=new ArrayList<>();

    //子订单状态，参考下面的备注
    @SerializedName("order_status")
    private String order_status;

    //已支付金额
    @SerializedName("payed_fee")
    private double payed_fee;

    //这个店铺的商品的总金额
    @SerializedName("payment")
    private double payment;

    //积分抵扣金额
    @SerializedName("points_fee")
    private double points_fee;

    //邮费
    @SerializedName("post_fee")
    private String post_fee;

    //减免金额
    @SerializedName("relief_fee")
    private double relief_fee;

    //商家昵称
    @SerializedName("shopName")
    private String shopName;

    //商家id
    @SerializedName("shop_id")
    private String shop_id;


    //用户可见的订单状态
    @SerializedName("status")
    private String status;

    //用户可见的订单状态
    @SerializedName("sync_pay_status")
    private String sync_pay_status;

    //用户可见的订单状态
    @SerializedName("sync_tid")
    private String sync_tid;


    //用户可见的订单状态
    @SerializedName("sync_trade_status")
    private String sync_trade_status;

    //订单id
    @SerializedName("tid")
    private String tid;

    //支付这个店铺的总金额
    @SerializedName("total_fee")
    private String total_fee;


    //商店状态
    @SerializedName("trade_status")
    private String trade_status;

    public String getCancel_status() {
        return cancel_status;
    }

    public void setCancel_status(String cancel_status) {
        this.cancel_status = cancel_status;
    }

    public String getCreated_time() {
        return created_time;
    }

    public void setCreated_time(String created_time) {
        this.created_time = created_time;
    }

    public List<GoodObject> getOrderList() {
        return orderList;
    }

    public void setOrderList(List<GoodObject> orderList) {
        this.orderList = orderList;
    }

    public String getOrder_status() {
        return order_status;
    }

    public void setOrder_status(String order_status) {
        this.order_status = order_status;
    }

    public double getPayed_fee() {
        return payed_fee;
    }

    public void setPayed_fee(double payed_fee) {
        this.payed_fee = payed_fee;
    }

    public double getPayment() {
        return payment;
    }

    public void setPayment(double payment) {
        this.payment = payment;
    }

    public double getPoints_fee() {
        return points_fee;
    }

    public void setPoints_fee(double points_fee) {
        this.points_fee = points_fee;
    }

    public String getPost_fee() {
        return post_fee;
    }

    public void setPost_fee(String post_fee) {
        this.post_fee = post_fee;
    }

    public double getRelief_fee() {
        return relief_fee;
    }

    public void setRelief_fee(double relief_fee) {
        this.relief_fee = relief_fee;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShop_id() {
        return shop_id;
    }

    public void setShop_id(String shop_id) {
        this.shop_id = shop_id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSync_pay_status() {
        return sync_pay_status;
    }

    public void setSync_pay_status(String sync_pay_status) {
        this.sync_pay_status = sync_pay_status;
    }

    public String getSync_tid() {
        return sync_tid;
    }

    public void setSync_tid(String sync_tid) {
        this.sync_tid = sync_tid;
    }

    public String getSync_trade_status() {
        return sync_trade_status;
    }

    public void setSync_trade_status(String sync_trade_status) {
        this.sync_trade_status = sync_trade_status;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public String getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(String total_fee) {
        this.total_fee = total_fee;
    }

    public String getTrade_status() {
        return trade_status;
    }

    public void setTrade_status(String trade_status) {
        this.trade_status = trade_status;
    }

    public String getStatusToString() {
        if (status.equals("WAIT_BUYER_PAY")) {
//            return "待付款";
            return "待付款";
        }
        if (status.equals("TRADE_CLOSED_BY_USER") || status.equals("TRADE_CLOSED_BY_SYSTEM") || status.equals("TRADE_CLOSED_BY_ADMIN")) {
            return "已取消";
        }
        if (status.equals("WAIT_SELLER_SEND_GOODS")) {
//            return "待发货";
            return "买家已付款";
        }
        if (status.equals("WAIT_BUYER_CONFIRM_GOODS")) {
//            return "待收货";
            return "卖家已发货";
        }
        if (status.equals("TRADE_FINISHED")) {
//            return "已完成";
            return "交易成功";
        }
        if (status.equals("IN_STOCK")) {
            return "备货中";
        }
        if (status.equals("WAIT_COMMENT")) {
            return "待评论";
        }
        return "退换货";//都不符合的情况返回退货
    }
}
